/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elaborate.tag_analysis.client.utils;

import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author lendle
 */
public class TableUtil {
    public static void clearJTableWithDefaultModel(final JTable table){
        DefaultTableModel model=(DefaultTableModel) table.getModel();
        while(model.getRowCount()>0){
            model.removeRow(0);
        }
        SwingUtilities.invokeLater(new Runnable(){

            @Override
            public void run() {
                table.updateUI();
            }
        });
    }
}
